#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
import sys,os
from app import App

sys.path.append(os.path.dirname(__file__))
if os.path.dirname(__file__):
    os.chdir(os.path.dirname(__file__))


application = App.wsgi_app()

RUN_WERKZEUG = 0
if __name__ == '__main__':
    AppConfig()
    if RUN_WERKZEUG:
        from werkzeug.serving import run_simple
        run_simple('localhost',8080,application,use_reloader=True,use_debugger=True)
    else:
        from wsgiref.simple_server import make_server
        httpd = make_server('localhost',8080,application)
        httpd.serve_forever()